<?php

require_once 'Custom/Model/Db.php';

class Link extends Custom_Model_Db
{
	/**
	 * The default table name 
	 */
    protected $_name 			= 	'link';
    protected $_primary 		=	'id';
	
	
	/**
	 * 后台AJAX数据列表
	 * @param String $where
	 * @param String $order
	 * @param int $count
	 * @param int $offset
	 */
	public function getAjaxData($where = null, $order = null, $count = null, $offset = null)
	{
		try {
           	$db = $this->getAdapter();
			$obj=$db->select()
			->from(array('g'=>$this->dbprefix.'link'),'*')
			//->joinLeft(array('m'=>$this->dbprefix.'member'),'m.uid=g.uid',array('uid','username'))
			->where($where)
			->order($order)
			->limit($count, $offset);
			//$sql = $obj->__toString();//生成SQL语句
			
			$array=$db->fetchAll($obj);
			return $array;
        } catch (Exception $e) {
			return false;
        }
	}
    
}